<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'ProductType.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript" src="<%=path%>/js/jquery-1.6.2.min.js"></script>
  <script type="text/javascript">
  function modify(value) {
	  alert(value);
		$(location).attr('href','<%=path%>/Product_AddProductType?CNameB='+value);
}

  function deltr(opp,value) {
	    alert(value);
	     $.ajax({
				cache: true,
				type: "POST",
				url:'<%=path%>/Product_deletedata?CNameB='+ value,	 
				async: false,
				error: function(request) {
				alert("发送请求失败！"+request.responseText);
				},
				success: function(data) {
				//alert("成功");
				}
				});
	    
		$(opp).parent().parent().remove();//移除当前行
	    $(location).attr('href','<%=path%>/Product_QueryType2');
		}
	</script>
  </head>
  
  <body>
   <%--  <s:action name="Product_QueryType2"  namespace="/"></s:action> --%>
    <table class="certTable" id="mytable" cellSpacing="0" cellPadding="2"
		width="100%" bgColor="#ffffff" border="2" >

		<tr>

			<th scope="col" abbr="Dual 1.8">一级类别名</th>
			<th scope="col" abbr="Dual 1.8">一级类别名（英文）</th>
			<th scope="col" abbr="Dual 1.8">二级类别名</th>
			<th scope="col" abbr="Dual 1.8">二级类别名（英文）</th>
			<th scope="col" abbr="Dual 1.8">描述</th>
			<th scope="col" abbr="Dual 1.8">创建人</th>
			<th scope="col" abbr="Dual 1.8">创建时间</th>
			<th scope="col" abbr="Dual 1.8">修改人</th>
			<th scope="col" abbr="Dual 1.8">修改时间</th>
			<th scope="col" abbr="Dual 1.8">状态</th>
			<th scope="col" abbr="Dual 1.8">操作</th>
		</tr>
		<s:iterator value="#request.PTL" var="d">
			<tr onMouseover="this.style.background='#A020F0'" onmouseout ="this.style.background=''">
				<td align="center">${d.CNameA }</td>
				<td align="center">${d.CNameeA }</td>
				<td align="center">${d.CNameB }</td>
				<td align="center">${d.CNameeB }</td>
				<td align="center">${d.CDescription }</td>
				<td align="center">${d.CCreator }</td>
				<td align="center"><s:date  name="#d.CCreatetime" format="yyyy-MM-dd hh:mm:ss"/></td>
				<td align="center">${d.CModifier }</td>
				<td align="center"><s:date  name="#d.CModifytime" format="yyyy-MM-dd hh:mm:ss"/></td>
			    
				<td align="center">
				<a id="edit" href="javascript:modify('${d.CNameB }')">修改
				</a>
				</td>
				<td align="center"><a id="delete" href="javascript:deltr(this,'${d.CNameB }')">删除</a>&nbsp;&nbsp;</td>
			</tr>
		</s:iterator>
	</table>
  </body>
</html>
